/*

*/

#include "User.h";

CUser::CUser(void *usrConnection) 
{
	
	/* initialise the bootstrap for this user */
	this->addProcess(new CProcess(os_LoadFile("system","bootstrap.program"), (HANDLE)(void*)this));

}

CUser::~CUser()
{

}

void CUser::addOutboundPacket(CPacket* p) 
{
	_outboundPackets.push(p);
}

void CUser::addProcess(void* p) 
{

}

void CUser::checkCompletedProcesses() 
{
}

void CUser::removeProcess(void* p)
{

}

int	CUser::getOutstandingPacketCount()
{
	return _outboundPackets.size();
}


CPacket* CUser::getNextPacket()
{
	if(_outboundPackets.size())
	{
		CPacket* p = _outboundPackets.front();
		return p;
	}
	return NULL;
}

void CUser::destroyNextPacket()
{
	_outboundPackets.pop();
}

void CUser::handleInboundPacket(CPacket* p) 
{
	
	/* pass this packet to the correct process */

	switch(p->getPacketType())
	{
	case PACKET_AUTHENTICATE:
		{

		}
		break;
	default:
		break;
	}

}
